﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.UnloadPMI.CApUnloadPMILevelApp
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using DnProcessSimulateCommands.DetailedDataUtils;
using DnProcessSimulateCommands.PMI.UnloadPMI.Resources;
using EngineeringInternalExtension;
using Tecnomatix.Engineering;


namespace DnProcessSimulateCommands.UnloadPMI;

internal class CApUnloadPMILevelApp : CApDduUnloadDetailedDataBaseApp
{
  internal CApUnloadPMILevelApp(CUiPMIUnloadPMIInfoEnabler enabler)
  {
    this.m_enabler = (CUiDtuBaseEnabler) enabler;
  }

  protected override void InitMessages()
  {
    if (this.m_isMessagesInit)
      return;
    this.CommandName = UnloadPMILevelStringTable.CMD_NAME;
    this.RemoveDetailedLevelWarning = UnloadPMILevelStringTable.CMD_WARNING_REMOVING_PMI_LEVEL;
    this.FailedUnloadComponentMsg = UnloadPMILevelStringTable.CMD_WARNING_MSG_FAILED_UNLOAD_COMPONENTS;
    this.m_isMessagesInit = true;
  }

  protected override bool HasUnpreservedReferencedEntities(ITxComponent component)
  {
    return TxComponentEx.HasUnpreservedReferencedPMIs(component);
  }

  protected override void UnloadDetailed(TxLibraryStorage libraryStorageObject)
  {
    TxComponentEx.Reload(libraryStorageObject, false);
  }
}
